<?php

namespace JLPay\Models\Cashier;

use JLPay\Models\BaseRequest;

/**
 * 预下单请求
 */
class PreOrderRequest extends BaseRequest
{
    /**
     * API前缀
     */
    public const API_PREFIX = '/open/cashier/trans/trade';
    
    /**
     * API URI
     */
    public const API_URI = '/pre-order';

    protected ?string $merchNo = null;
    protected ?string $termNo = null;
    protected ?string $outTradeNo = null;
    protected ?string $paymentValidTime = null;
    protected ?string $description = null;
    protected ?string $attach = null;
    protected ?string $totalAmount = null;
    protected ?string $remark = null;
    protected ?string $notifyUrl = null;
    protected ?string $envVersion = null;
    protected ?string $merchAppid = null;
    protected ?string $returnUrl = null;

    /**
     * 设置商户号
     *
     * @param string $merchNo
     * @return self
     */
    public function setMerchNo(string $merchNo): self
    {
        $this->merchNo = $merchNo;
        return $this;
    }

    /**
     * 设置终端号
     *
     * @param string $termNo
     * @return self
     */
    public function setTermNo(string $termNo): self
    {
        $this->termNo = $termNo;
        return $this;
    }

    /**
     * 设置外部交易号
     *
     * @param string $outTradeNo
     * @return self
     */
    public function setOutTradeNo(string $outTradeNo): self
    {
        $this->outTradeNo = $outTradeNo;
        return $this;
    }

    /**
     * 设置支付有效期
     *
     * @param string $paymentValidTime
     * @return self
     */
    public function setPaymentValidTime(string $paymentValidTime): self
    {
        $this->paymentValidTime = $paymentValidTime;
        return $this;
    }

    /**
     * 设置商品描述
     *
     * @param string $description
     * @return self
     */
    public function setDescription(string $description): self
    {
        $this->description = $description;
        return $this;
    }

    /**
     * 设置附加数据
     *
     * @param string $attach
     * @return self
     */
    public function setAttach(string $attach): self
    {
        $this->attach = $attach;
        return $this;
    }

    /**
     * 设置总金额
     *
     * @param string $totalAmount
     * @return self
     */
    public function setTotalAmount(string $totalAmount): self
    {
        $this->totalAmount = $totalAmount;
        return $this;
    }

    /**
     * 设置备注
     *
     * @param string $remark
     * @return self
     */
    public function setRemark(string $remark): self
    {
        $this->remark = $remark;
        return $this;
    }

    /**
     * 设置通知地址
     *
     * @param string $notifyUrl
     * @return self
     */
    public function setNotifyUrl(string $notifyUrl): self
    {
        $this->notifyUrl = $notifyUrl;
        return $this;
    }

    /**
     * 设置环境版本
     *
     * @param string $envVersion
     * @return self
     */
    public function setEnvVersion(string $envVersion): self
    {
        $this->envVersion = $envVersion;
        return $this;
    }

    /**
     * 设置商户应用ID
     *
     * @param string $merchAppid
     * @return self
     */
    public function setMerchAppid(string $merchAppid): self
    {
        $this->merchAppid = $merchAppid;
        return $this;
    }

    /**
     * 设置返回地址
     *
     * @param string $returnUrl
     * @return self
     */
    public function setReturnUrl(string $returnUrl): self
    {
        $this->returnUrl = $returnUrl;
        return $this;
    }

    /**
     * 获取商户号
     *
     * @return string|null
     */
    public function getMerchNo(): ?string
    {
        return $this->merchNo;
    }

    /**
     * 获取终端号
     *
     * @return string|null
     */
    public function getTermNo(): ?string
    {
        return $this->termNo;
    }

    /**
     * 获取外部交易号
     *
     * @return string|null
     */
    public function getOutTradeNo(): ?string
    {
        return $this->outTradeNo;
    }

    /**
     * 获取支付有效期
     *
     * @return string|null
     */
    public function getPaymentValidTime(): ?string
    {
        return $this->paymentValidTime;
    }

    /**
     * 获取商品描述
     *
     * @return string|null
     */
    public function getDescription(): ?string
    {
        return $this->description;
    }

    /**
     * 获取附加数据
     *
     * @return string|null
     */
    public function getAttach(): ?string
    {
        return $this->attach;
    }

    /**
     * 获取总金额
     *
     * @return string|null
     */
    public function getTotalAmount(): ?string
    {
        return $this->totalAmount;
    }

    /**
     * 获取备注
     *
     * @return string|null
     */
    public function getRemark(): ?string
    {
        return $this->remark;
    }

    /**
     * 获取通知地址
     *
     * @return string|null
     */
    public function getNotifyUrl(): ?string
    {
        return $this->notifyUrl;
    }

    /**
     * 获取环境版本
     *
     * @return string|null
     */
    public function getEnvVersion(): ?string
    {
        return $this->envVersion;
    }

    /**
     * 获取商户应用ID
     *
     * @return string|null
     */
    public function getMerchAppid(): ?string
    {
        return $this->merchAppid;
    }

    /**
     * 获取返回地址
     *
     * @return string|null
     */
    public function getReturnUrl(): ?string
    {
        return $this->returnUrl;
    }
} 